// -----------------------------
// Author: 		Dhaenens Gert 
// Creation: 	12/12/2014 4:26:25 PM				
// -----------------------------

#ifndef _RefPtr_h
#define _RefPtr_h

#include "Defines.h"

template<typename T>
class RefPtr
{
public:
	explicit RefPtr(T* lpObj, Bool bIsInterface = false);
	RefPtr(const RefPtr<T>& refRefPTr);
	virtual ~RefPtr();
	RefPtr<T>& operator=(const RefPtr<T>& refRefPtr);

	const T*	operator->() const;
	T*			operator->();

	const T&	operator*() const;
	T&			operator*();

	const T*	Get() const;
	T*			Get();

	Bool		IsValid() const;
				operator Bool();

	void		AddRef();

private:
	UInt32*		m_lpRefCount;
	T*			m_lpObject;
	Bool		m_bIsInterface;
};

#include "RefPtr.inl"
#endif